﻿using System;
namespace RabbitMQExtension
{
    internal class DefaultLogger : ILog
    {
        public DefaultLogger(string logName)
        {

        }

        public void Debug(string message)
        {
            Console.WriteLine($"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")} [DEBUG] " + message);
        }

        public void Info(string message)
        {
            Console.WriteLine($"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")} [INFO] " + message);
        }

        public void Error(string message)
        {
            Console.WriteLine($"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")} [ERROR] " + message);
        }

        public void Error(Exception exception)
        {
            Console.WriteLine($"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")} [ERROR] " + exception?.ToString());
        }

        public void Error(string message, Exception exception)
        {
            Console.WriteLine($"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")} [ERROR] " + message + " - " + exception?.ToString());
        }

        public void Warn(string message)
        {
            Console.WriteLine($"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")} [WARN] " + message);
        }

        public void Warn(Exception exception)
        {
            Console.WriteLine($"{DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")} [WARN] " + exception?.ToString());
        }
    }
}